<template>
  <div class="remarks-style">
    <div
      class="close-box"
      :style="{ width: isMobile ? '24px' : '', height: isMobile ? '24px' : '' }"
      :class="{ 'close-2': isMobile }"
      @click="store.setChildRemarksShow(false)"
    >
      <!-- <i class="doorIcon">&#xe63d;</i> closeIconBox-->
      <img
        :style="{ width: isMobile ? '24px' : '', height: isMobile ? '24px' : '' }"
        :src="publicUrls + 'free/style7/scrollBcakground1Marskclose.webp'"
        alt=""
      />
    </div>

    <div
      class="remarks-style-conetnt"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style7/scrollBcakground1Marsk.webp'})`,
      }"
    >
      <div class="remarks-style-left">
        <div class="title-box">
          <p class="title">{{ store.childTitle }}</p>
          <p class="sub-title" v-if="store.childSubTitle">——{{ store.childSubTitle }}</p>
        </div>
        <scrollBox
          :tabbmScroll="getTabmComputed"
          color="rgba(51, 51, 51, 1)"
          v-if="Scrollheights"
          :remarks="store.childRemarks"
          :byid="100"
          :isTop="true"
          :height="getScrollWComputed"
        >
          <template #solidBorder>
            <div class="solidBorder-child"></div>
          </template>
        </scrollBox>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'styleOne',
});
</script>

<script setup lang="ts">
import { getMobileType } from '@/utils/getMoble';
import { publicUrls } from '@/utils/minxin';
import scrollBox from '../../../pages/public/copyright/scrollBox10.vue';
import { useProjectStore } from '@/store';
import { ref, computed, defineComponent } from 'vue';

const isMobile = ref(false);
isMobile.value = getMobileType();
const store = useProjectStore();
let viewportHeight = window.innerHeight;
const Scrollheights = ref();
Scrollheights.value = (viewportHeight / 900) * 420;
const getScrollWComputed = computed(() => {
  if (store.isMobileType) {
    let rootNode = document.documentElement;

    let computedStyle = window.getComputedStyle(rootNode);

    let fontSize = computedStyle.fontSize;

    let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
    // let heights = (fontSizeNumber / 144)
    let heights = (fontSizeNumber / 144) * 420;
    return heights;
  } else {
    return Scrollheights.value;
  }
});
const getTabmComputed = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
  let heights = (fontSizeNumber / 144) * 60;
  return heights;
});
</script>   

<style scoped lang="less">
.remarks-style {
  display: flex;
  flex-direction: column;
  position: relative;
  //   width: 100%;
  //   max-width: 1200px;
  width: 1130px;
  height: 640px;
  background: transparent;

  transform: translateZ(0px);
}
.remarks-style-conetnt {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  //   background: #fff;
  background-repeat: no-repeat;
  background-size: 100% 100%;

  padding: 40px 80px;
  //   object-fit: contain;
}

.remarks-style-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  // flex: 1;
  width: 100%;
  height: 100%;
}
.title-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}
.title {
  font-family: SourceHanSerifCN-Bold;
  font-size: 32px;

  line-height: 51.2px;
  text-align: left;
  color: rgba(112, 157, 134, 1);
}
.sub-title {
  font-family: SourceHanSerifCN;
  font-size: 18px;
  color: rgba(112, 157, 134, 1);
  line-height: 28px;
  margin-top: 8px;
}
.solidBorder-child {
  width: 1px;
  height: 100%;
  background: rgba(156, 180, 158, 1);
  border-radius: 1px;
}
::v-deep .scrollBar {
  width: 5px;
  height: 100%;
  background: rgba(156, 180, 158, 1);
  border-radius: 2px;
}

.close-box {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -16px;
  right: -20px;
  width: 48px;
  height: 48px;
  z-index: 30;
  img {
    width: 48px;
    height: 48px;
    object-fit: contain;
  }
}
.close-2 {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
 top: -16px;
  right: -20px;
  width: 32px;
  height: 32px;

  z-index: 30;
  img {
    width: 100%;
    height: 100%;
  }
}
::v-deep .templatestyle1-scroll-box-tumb {
  display: flex;
  justify-content: center;
  top: -4px;
  .scrollBar {
    width: 5px;
    // height: 100%;
    height: 60px;
    background: rgba(156, 180, 158, 1);
    border-radius: 25px;
    box-shadow: none;
    margin-left: 1px;
  }
}
::v-deep {
  .solid-box-parent {
    width: 32px;
  }
  .unit-exbi-remarks-info-remarks {
    width: calc(100% - 6px);
  }
}
:deep(.unit-exbi-remarks-info-remarks p) {
  font-family: PingFang SC;
  font-weight: 400;
  font-size: 16px !important;
  color: rgba(51, 51, 51, 1) !important;
  line-height: 32px !important;
  margin-bottom: 24px;
}
:deep(.solid-box-parent) {
  position: absolute;
  right: -17px;
  // margin-right: -32px;
}
:deep(.unit-exbit-null-remarks-info) {
  display: flex;
  align-items: center;
  height: 100%;
}
</style>
